package com.book.shop.repository;

import com.book.shop.model.User;
import org.springframework.data.jpa.repository.EntityGraph;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface UserRepository extends JpaRepository<User,Long> {

    public User findByUserName(String userName);

    @EntityGraph(attributePaths = "roles")
    public User findOneWithRolesByUserName(String userName);

}
